using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.Article;


namespace HengTong.ViewModel.Article.SysArticleCategoryVms
{
    public partial class SysArticleCategoryTemplateVm : BaseTemplateVM
    {
        [Display(Name = "分类名称")]
        public ExcelPropety CategoryNameExcel = ExcelPropety.CreateProperty<SysArticleCategory>(x => x.CategoryName);
        [Display(Name = "分类编码")]
        public ExcelPropety CategoryCodeExcel = ExcelPropety.CreateProperty<SysArticleCategory>(x => x.CategoryCode);
        [Display(Name = "分类描述")]
        public ExcelPropety DescriptionExcel = ExcelPropety.CreateProperty<SysArticleCategory>(x => x.Description);
        [Display(Name = "分类图标")]
        public ExcelPropety IconExcel = ExcelPropety.CreateProperty<SysArticleCategory>(x => x.Icon);
        [Display(Name = "分类颜色")]
        public ExcelPropety ColorExcel = ExcelPropety.CreateProperty<SysArticleCategory>(x => x.Color);
        [Display(Name = "排序")]
        public ExcelPropety SortOrderExcel = ExcelPropety.CreateProperty<SysArticleCategory>(x => x.SortOrder);
        [Display(Name = "是否启用")]
        public ExcelPropety IsActiveExcel = ExcelPropety.CreateProperty<SysArticleCategory>(x => x.IsActive);
        [Display(Name = "是否显示")]
        public ExcelPropety IsVisibleExcel = ExcelPropety.CreateProperty<SysArticleCategory>(x => x.IsVisible);
        [Display(Name = "_Admin.Parent")]
        public ExcelPropety ParentExcel = ExcelPropety.CreateProperty<SysArticleCategory>(x => x.ParentId);

	    protected override void InitVM()
        {
            ParentExcel.DataType = ColumnDataType.ComboBox;
            ParentExcel.ListItems = DC.Set<SysArticleCategory>().GetSelectListItems(Wtm, y => y.CategoryName);
        }

    }

    public class SysArticleCategoryImportVm : BaseImportVM<SysArticleCategoryTemplateVm, SysArticleCategory>
    {

    }

}
